package com.bobo.service;

import com.bobo.dto.VoucherPageQueryDTO;
import com.bobo.entity.Voucher;
import com.bobo.entity.VoucherOrder;
import com.bobo.result.Result;

import java.util.List;

public interface VoucherService {
    void addVoucher(Voucher voucher);

    Result<Long> getVoucher(Long id) throws InterruptedException;

    List<Voucher> getVoucherByPage(VoucherPageQueryDTO voucherPageQueryDTO);

    void updateVoucherStatus(Integer status ,Long id);

    void updateVoucher(Voucher voucher);

    void deleteVoucher(Long id);

    Integer getUserIdByOrderId(Long orderId);

    void addVoucherOrder(Long voucherId,VoucherOrder voucherOrder);

    void doDBOperation(VoucherOrder voucherOrder);

    void expireVoucherOrderHandler(VoucherOrder voucherOrder);

    void DBAndRedisRollBack(VoucherOrder voucherOrder);
}
